Matting is a technique used in photography and filmmaking to create visual effects by compositing a foreground image with a background image, by using a matte that masks the shape of the foreground image. In filmmaking, matting is typically performed by using a green screen (or blue screen) in a process commonly known as chroma keying or color difference matting.
FIG. 1 is a view for explaining the chroma keying matting technique. As shown in FIG. 1, a scene is arranged in which a principal subject is positioned in front of a background screen consisting of a single color, such as a green color (green screen), and an image of the scene is captured, the captured image being the foreground image. After capture, the foreground image is encoded in accordance with a typical coding standard, such as, for example, JPEG 2000 and the like. During the compositing process, the foreground image is decoded, and matte extraction is performed to extract a binary mask that separates the background pixels from the foreground pixels of the foreground image. An encoded background image is accessed and decoded, and the foreground image is composited (blended) with the decoded background image using the binary mask to form a composited image. The composited image is formed such that the background pixels of the decoded foreground image are replaced with corresponding pixels of the decoded background image.
Other matting techniques include rotoscoping, and matting techniques that use cues other than color difference, such as techniques that use cues from infrared or polarized light.
To minimize edge artifacts, high quality image data is typically used for matting. For example, video image data in a progressive, non-interlaced format is typically used, lossless (or slightly lossy) compression is typically used, raw image data (i.e., image data that is not color balanced or otherwise corrected or tone mapped) is typically used, and high-resolution image data (e.g., 4K format) is typically used.